<!DOCTYPE html>
<html lang="en">

<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
	<meta name="keywords" content="open-API" />
	<meta name="description" content="open-API" />
	<!-- 网页标签标题 -->
	<title>open-API</title>
	<link rel="shortcut icon" href="/img/nacos.ico"/>
	<link rel="stylesheet" href="/build/documentation.css" />
</head>
<body>
	<div id="root"><div class="documentation-page" data-reactroot="" data-reactid="1" data-react-checksum="1542482401"><header class="header-container header-container-normal" data-reactid="2"><div class="header-body" data-reactid="3"><a href="/en-us/index.html" data-reactid="4"><img class="logo" src="/img/nacos_colorful.png" data-reactid="5"/></a><span class="language-switch language-switch-normal" data-reactid="6">中</span><div class="header-menu" data-reactid="7"><img class="header-menu-toggle" src="/img/menu_gray.png" data-reactid="8"/><ul data-reactid="9"><li class="menu-item menu-item-normal" data-reactid="10"><a href="/en-us/index.html" data-reactid="11">HOME</a></li><li class="menu-item menu-item-normal menu-item-normal-active" data-reactid="12"><a href="/en-us/docs/quick-start.html" data-reactid="13">DOCS</a></li><li class="menu-item menu-item-normal" data-reactid="14"><a href="/en-us/blog" data-reactid="15">BLOG</a></li><li class="menu-item menu-item-normal" data-reactid="16"><a href="/en-us/community" data-reactid="17">COMMUNITY</a></li><li class="menu-item menu-item-normal" data-reactid="18"><a href="http://console.nacos.io/nacos/index.html" data-reactid="19">DEMO-CONSOLE</a></li></ul></div></div></header><div class="bar" data-reactid="20"><div class="bar-body" data-reactid="21"><img src="/img/docs.png" class="front-img" data-reactid="22"/><div class="bar-title" data-reactid="23"><span data-reactid="24">Documentation</span><div class="bone bone-light" data-reactid="25"></div></div><img src="/img/docs.png" class="back-img" data-reactid="26"/></div></div><section class="content-section" data-reactid="27"><div class="content-body" data-reactid="28"><div class="sidemenu" data-reactid="29"><div class="sidemenu-toggle" data-reactid="30"><img src="https://img.alicdn.com/tfs/TB1E6apXHGYBuNjy0FoXXciBFXa-200-200.png" data-reactid="31"/></div><ul data-reactid="32"><li class="menu-item menu-item-level-1" data-reactid="33"><span data-reactid="34">Nacos </span><ul data-reactid="35"><li style="height:144px;overflow:hidden;" class="menu-item menu-item-level-2" data-reactid="36"><span data-reactid="37"><!-- react-text: 38 -->What is Nacos<!-- /react-text --><img style="transform:rotate(0deg);" class="menu-toggle" src="/img/arrow_down.png" data-reactid="39"/></span><ul data-reactid="40"><li class="menu-item menu-item-level-3" data-reactid="41"><a href="/en-us/docs/what-is-nacos.html" target="_self" data-reactid="42">What is Nacos</a></li><li class="menu-item menu-item-level-3" data-reactid="43"><a href="/en-us/docs/concepts.html" target="_self" data-reactid="44">Concepts</a></li><li class="menu-item menu-item-level-3" data-reactid="45"><a href="/en-us/docs/architecture.html" target="_self" data-reactid="46">Architecure</a></li></ul></li><li style="height:216px;overflow:hidden;" class="menu-item menu-item-level-2" data-reactid="47"><span data-reactid="48"><!-- react-text: 49 -->Quick Start<!-- /react-text --><img style="transform:rotate(0deg);" class="menu-toggle" src="/img/arrow_down.png" data-reactid="50"/></span><ul data-reactid="51"><li class="menu-item menu-item-level-3" data-reactid="52"><a href="/en-us/docs/quick-start.html" target="_self" data-reactid="53">Nacos</a></li><li class="menu-item menu-item-level-3" data-reactid="54"><a href="/en-us/docs/quick-start-spring.html" target="_self" data-reactid="55">Nacos Spring</a></li><li class="menu-item menu-item-level-3" data-reactid="56"><a href="/en-us/docs/quick-start-spring-boot.html" target="_self" data-reactid="57">Nacos Spring Boot</a></li><li class="menu-item menu-item-level-3" data-reactid="58"><a href="/en-us/docs/quick-start-spring-cloud.html" target="_self" data-reactid="59">Nacos Spring Cloud</a></li><li class="menu-item menu-item-level-3" data-reactid="60"><a href="/en-us/docs/quick-start-docker.html" target="_self" data-reactid="61">Nacos Docker</a></li></ul></li><li style="height:180px;overflow:hidden;" class="menu-item menu-item-level-2" data-reactid="62"><span data-reactid="63"><!-- react-text: 64 -->User Guide<!-- /react-text --><img style="transform:rotate(0deg);" class="menu-toggle" src="/img/arrow_down.png" data-reactid="65"/></span><ul data-reactid="66"><li class="menu-item menu-item-level-3" data-reactid="67"><a href="/en-us/docs/sdk.html" target="_self" data-reactid="68">Java SDK</a></li><li class="menu-item menu-item-level-3" data-reactid="69"><a href="/en-us/docs/other-language.html" target="_self" data-reactid="70">Other Language</a></li><li class="menu-item menu-item-level-3" data-reactid="71"><a href="/en-us/docs/open-API.html" target="_self" data-reactid="72">Open-API</a></li><li class="menu-item menu-item-level-3" data-reactid="73"><a href="/en-us/docs/nacos-spring.html" target="_self" data-reactid="74">Nacos Spring</a></li></ul></li><li style="height:36px;overflow:hidden;" class="menu-item menu-item-level-2" data-reactid="75"><span data-reactid="76"><!-- react-text: 77 -->Admin Guide<!-- /react-text --><img style="transform:rotate(-90deg);" class="menu-toggle" src="/img/arrow_down.png" data-reactid="78"/></span><ul data-reactid="79"><li class="menu-item menu-item-level-3" data-reactid="80"><a href="/en-us/docs/deployment.html" target="_self" data-reactid="81">Deployment Guide</a></li><li class="menu-item menu-item-level-3" data-reactid="82"><a href="/en-us/docs/cluster-mode-quick-start.html" target="_self" data-reactid="83">Cluster Mode Deployment</a></li><li class="menu-item menu-item-level-3" data-reactid="84"><a href="/en-us/docs/managementAPI.html" target="_self" data-reactid="85">Management OpenAPI</a></li><li class="menu-item menu-item-level-3" data-reactid="86"><a href="/en-us/docs/CLI-guide.html" target="_self" data-reactid="87">Nacos Operator CLI Guide</a></li><li class="menu-item menu-item-level-3" data-reactid="88"><a href="/en-us/docs/console-guide.html" target="_self" data-reactid="89">Admin Console Guide</a></li></ul></li><li style="height:36px;overflow:hidden;" class="menu-item menu-item-level-2" data-reactid="90"><span data-reactid="91"><!-- react-text: 92 -->Contributor Guide<!-- /react-text --><img style="transform:rotate(-90deg);" class="menu-toggle" src="/img/arrow_down.png" data-reactid="93"/></span><ul data-reactid="94"><li class="menu-item menu-item-level-3" data-reactid="95"><a href="/en-us/docs/contributing.html" target="_self" data-reactid="96">Contribute to Nacos</a></li><li class="menu-item menu-item-level-3" data-reactid="97"><a href="/zh-cn/docs/activity.html" target="_self" data-reactid="98">Nacos Activity</a></li><li class="menu-item menu-item-level-3" data-reactid="99"><a href="/en-us/docs/pull-request.html" target="_self" data-reactid="100">Pull Request Template</a></li><li class="menu-item menu-item-level-3" data-reactid="101"><a href="/en-us/docs/how-to-reporting-bugs.html" target="_self" data-reactid="102">How to reporting bugs</a></li><li class="menu-item menu-item-level-3" data-reactid="103"><a href="/en-us/docs/roadmap.html" target="_self" data-reactid="104">Nacos RoadMap</a></li><li class="menu-item menu-item-level-3" data-reactid="105"><a href="/en-us/docs/use-nacos-with-springcloud.html" target="_self" data-reactid="106">Nacos with SpringCloud</a></li><li class="menu-item menu-item-level-3" data-reactid="107"><a href="/en-us/docs/use-nacos-with-dubbo.html" target="_self" data-reactid="108">Nacos with Dubbo</a></li><li class="menu-item menu-item-level-3" data-reactid="109"><a href="/en-us/docs/use-nacos-with-kubernetes.html" target="_self" data-reactid="110">Nacos with K8s</a></li><li class="menu-item menu-item-level-3" data-reactid="111"><a href="/en-us/docs/use-nacos-with-istio.html" target="_self" data-reactid="112">Nacos with Istio</a></li></ul></li><li style="height:36px;overflow:hidden;" class="menu-item menu-item-level-2" data-reactid="113"><span data-reactid="114"><!-- react-text: 115 -->Community<!-- /react-text --><img style="transform:rotate(-90deg);" class="menu-toggle" src="/img/arrow_down.png" data-reactid="116"/></span><ul data-reactid="117"><li class="menu-item menu-item-level-3" data-reactid="118"><a href="/en-us/docs/community.html" target="_self" data-reactid="119">Community</a></li></ul></li></ul></li></ul></div><div class="doc-content markdown-body" data-reactid="120"><h1>Configuration Management</h1>
<h2>Get configurations</h2>
<h3>Description</h3>
<p>This API is used to get configurations in Nacos.</p>
<h3>Request type</h3>
<p>GET</p>
<h3>Request URL</h3>
<p>/nacos/v1/cs/configs</p>
<h3>Request parameters</h3>
<table>
<thead>
<tr>
<th style="text-align:left">Name</th>
<th style="text-align:left">Type</th>
<th style="text-align:left">Required</th>
<th style="text-align:left">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">tenant</td>
<td style="text-align:left">string</td>
<td style="text-align:left">No</td>
<td style="text-align:left">Tenant information. It corresponds to the Namespace field in Nacos.</td>
</tr>
<tr>
<td style="text-align:left">dataId</td>
<td style="text-align:left">string</td>
<td style="text-align:left">Yes</td>
<td style="text-align:left">Configuration ID</td>
</tr>
<tr>
<td style="text-align:left">group</td>
<td style="text-align:left">string</td>
<td style="text-align:left">Yes</td>
<td style="text-align:left">Configuration group</td>
</tr>
</tbody>
</table>
<h3>Return parameters</h3>
<table>
<thead>
<tr>
<th style="text-align:left">Parameter type</th>
<th style="text-align:left">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">String</td>
<td style="text-align:left">Configuration value</td>
</tr>
</tbody>
</table>
<h3>Error codes</h3>
<table>
<thead>
<tr>
<th style="text-align:left">Error code</th>
<th style="text-align:left">Description</th>
<th style="text-align:left">Meaning</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">400</td>
<td style="text-align:left">Bad Request</td>
<td style="text-align:left">Syntax error in the client request</td>
</tr>
<tr>
<td style="text-align:left">403</td>
<td style="text-align:left">Forbidden</td>
<td style="text-align:left">No permission</td>
</tr>
<tr>
<td style="text-align:left">404</td>
<td style="text-align:left">Not Found</td>
<td style="text-align:left">Not found resource</td>
</tr>
<tr>
<td style="text-align:left">500</td>
<td style="text-align:left">Internal Server Error</td>
<td style="text-align:left">Internal server error</td>
</tr>
<tr>
<td style="text-align:left">200</td>
<td style="text-align:left">OK</td>
<td style="text-align:left">Normal</td>
</tr>
</tbody>
</table>
<h3>Example</h3>
<ul>
<li>
<p>Request example</p>
<pre><code>http:serverIp:8848/nacos/v1/cs/configs?dataId=dataIdparam&amp;group=groupParam&amp;tenant=tenantParam

</code></pre>
</li>
<li>
<p>Return example</p>
<pre><code>contentTest
</code></pre>
</li>
</ul>
<h2>Listen for configurations</h2>
<h3>Description</h3>
<p>This API is used to listen for configurations in Nacos to capture configuration changes. In case of any configuration changes, you can use the <a href="~~64131~~">Get Configurations</a> API to obtain the latest value of the configuration and dynamically refresh the local cache.</p>
<p>A listener is registered using an asynchronous servlet. The nature of registering a listener is to compare the configuration value and the MD5 value of it with that of the backend. If the values differ, the inconsistent configuration is returned immediately. Otherwise, an empty string is returned after 30 seconds.</p>
<h3>Request type</h3>
<p>POST</p>
<h3>Request URL</h3>
<p>/nacos/v1/cs/configs/listener</p>
<h3>Request parameters</h3>
<div class="bi-table">
  <table>
    <colgroup>
      <col width="auto" />
      <col width="75px" />
      <col width="96px" />
      <col width="385px" />
    </colgroup>
    <tbody>
      <tr>
        <td rowspan="1" colSpan="1">
          <div data-type="p">Name</div>
        </td>
        <td rowspan="1" colSpan="1">
          <div data-type="p">Type</div>
        </td>
        <td rowspan="1" colSpan="1">
          <div data-type="p">Required</div>
        </td>
        <td rowspan="1" colSpan="1">
          <div data-type="p">Description</div>
        </td>
      </tr>
      <tr>
        <td rowspan="1" colSpan="1">
          <div data-type="p">Listening-Configs</div>
        </td>
        <td rowspan="1" colSpan="1">
          <div data-type="p">string</div>
        </td>
        <td rowspan="1" colSpan="1">
          <div data-type="p">No</div>
        </td>
        <td rowspan="1" colSpan="1">
          <div data-type="p">A request to listen for data packets. </div>
          <div data-type="p">Format : dataId^group^2contentMD5^tenant^1 or dataId^group^2contentMD5^1.</div>
          <ul data-type="unordered-list">
            <li data-type="list-item" data-list-type="unordered-list">
              <div data-type="p">dataId : Configuration ID</div>
            </li>
            <li data-type="list-item" data-list-type="unordered-list">
              <div data-type="p">group : Configuration group</div>
            </li>
            <li data-type="list-item" data-list-type="unordered-list">
              <div data-type="p">contentMD5 : The MD5 value of the configuration</div>
            </li>
            <li data-type="list-item" data-list-type="unordered-list">
              <div data-type="p">tenant : Tenant information. It corresponds to the Namespace field in Nacos (not must)</div>
            </li>
          </ul>
        </td>
      </tr>
      <tr>
        <td rowspan="1" colSpan="1">
          <div data-type="p">Listening-Configs</div>
        </td>
        <td rowspan="1" colSpan="1">
          <div data-type="p">string</div>
        </td>
        <td rowspan="1" colSpan="1">
          <div data-type="p">Yes</div>
        </td>
        <td rowspan="1" colSpan="1">
          <div data-type="p">A request to listen for data packets.</div>
        </td>
      </tr>
      <tr>
        <td rowspan="1" colSpan="1">
          <div data-type="p">tenant</div>
        </td>
        <td rowspan="1" colSpan="1">
          <div data-type="p">string</div>
        </td>
        <td rowspan="1" colSpan="1">
          <div data-type="p">Yes</div>
        </td>
        <td rowspan="1" colSpan="1">
          <div data-type="p">A packet field indicating tenant information. It corresponds to the Namespace field in Nacos.</div>
        </td>
      </tr>
      <tr>
        <td rowspan="1" colSpan="1">
          <div data-type="p">dataId</div>
        </td>
        <td rowspan="1" colSpan="1">
          <div data-type="p">string</div>
        </td>
        <td rowspan="1" colSpan="1">
          <div data-type="p">Yes</div>
        </td>
        <td rowspan="1" colSpan="1">
          <div data-type="p">A packet field indicating the configuration ID.</div>
        </td>
      </tr>
      <tr>
        <td rowspan="1" colSpan="1">
          <div data-type="p">group</div>
        </td>
        <td rowspan="1" colSpan="1">
          <div data-type="p">string</div>
        </td>
        <td rowspan="1" colSpan="1">
          <div data-type="p">Yes</div>
        </td>
        <td rowspan="1" colSpan="1">
          <div data-type="p">A packet field indicating the configuration group.</div>
        </td>
      </tr>
      <tr>
        <td rowspan="1" colSpan="1">
          <div data-type="p">contentMD5</div>
        </td>
        <td rowspan="1" colSpan="1">
          <div data-type="p">string</div>
        </td>
        <td rowspan="1" colSpan="1">
          <div data-type="p">Yes</div>
        </td>
        <td rowspan="1" colSpan="1">
          <div data-type="p">A packet field indicating the MD5 value of the configuration.</div>
        </td>
      </tr>
    </tbody>
  </table>
</div>
<h3>Header parameters</h3>
<table>
<thead>
<tr>
<th style="text-align:left">Name</th>
<th style="text-align:left">Type</th>
<th style="text-align:left">Required</th>
<th style="text-align:left">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">Long-Pulling-Timeout</td>
<td style="text-align:left">string</td>
<td style="text-align:left">Yes</td>
<td style="text-align:left">The timeout for long polling is 30s. Enter 30,000 here.</td>
</tr>
</tbody>
</table>
<h3>Parameter description</h3>
<ul>
<li>A delimiter to separate fields within a configuration: ^2  = Character.toString((char) 2</li>
<li>A delimiter to separate configurations: ^1 = Character.toString((char) 1)</li>
<li>contentMD5:  MD5(content). This is an empty string because the first local cache is empty.</li>
</ul>
<h3>Return parameters</h3>
<table>
<thead>
<tr>
<th style="text-align:left">Parameter type</th>
<th style="text-align:left">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">String</td>
<td style="text-align:left">Configuration value</td>
</tr>
</tbody>
</table>
<h3>Error codes</h3>
<table>
<thead>
<tr>
<th style="text-align:left">Error code</th>
<th style="text-align:left">Description</th>
<th style="text-align:left">Meaning</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">400</td>
<td style="text-align:left">Bad Request</td>
<td style="text-align:left">Syntax error in the client request</td>
</tr>
<tr>
<td style="text-align:left">403</td>
<td style="text-align:left">Forbidden</td>
<td style="text-align:left">No permission</td>
</tr>
<tr>
<td style="text-align:left">404</td>
<td style="text-align:left">Not Found</td>
<td style="text-align:left">Client error, not found</td>
</tr>
<tr>
<td style="text-align:left">500</td>
<td style="text-align:left">Internal Server Error</td>
<td style="text-align:left">Internal server error</td>
</tr>
<tr>
<td style="text-align:left">200</td>
<td style="text-align:left">OK</td>
<td style="text-align:left">Normal</td>
</tr>
</tbody>
</table>
<h3>Example</h3>
<ul>
<li>Request example</li>
</ul>
<pre><code>http://serverIp:8848/nacos/v1/cs/configs/listener

POST request body data:

Listening-Configs=dataId^2group^2contentMD5^2tenant^1

</code></pre>
<ul>
<li>Return example</li>
</ul>
<pre><code>In case of any configuration changes,

dataId^2group^2tenant^1

Otherwise, an empty string is returned.

</code></pre>
<h2>Publish configuration</h2>
<h3>Description</h3>
<p>It publishes configurations in Nacos.</p>
<h3>Request Type</h3>
<p>POST</p>
<h3>Request URL</h3>
<p>/nacos/v1/cs/configs</p>
<h3>Request parameters</h3>
<table>
<thead>
<tr>
<th style="text-align:left">Name</th>
<th style="text-align:left">Type</th>
<th style="text-align:left">Required</th>
<th style="text-align:left">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">tenant</td>
<td style="text-align:left">String</td>
<td style="text-align:left">No</td>
<td style="text-align:left">The tenant, corresponding to the namespace field of Nacos</td>
</tr>
<tr>
<td style="text-align:left">dataId</td>
<td style="text-align:left">String</td>
<td style="text-align:left">Yes</td>
<td style="text-align:left">Configuration ID</td>
</tr>
<tr>
<td style="text-align:left">group</td>
<td style="text-align:left">String</td>
<td style="text-align:left">Yes</td>
<td style="text-align:left">Configuration group</td>
</tr>
<tr>
<td style="text-align:left">content</td>
<td style="text-align:left">String</td>
<td style="text-align:left">Yes</td>
<td style="text-align:left">Configuration content</td>
</tr>
</tbody>
</table>
<h3>Response parameters</h3>
<table>
<thead>
<tr>
<th>Parametertype</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>boolean</td>
<td>If the publishing is successful</td>
</tr>
</tbody>
</table>
<h3>Error code</h3>
<table>
<thead>
<tr>
<th style="text-align:left">Error code</th>
<th style="text-align:left">Description</th>
<th style="text-align:left">Meaning</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">400</td>
<td style="text-align:left">Bad Request</td>
<td style="text-align:left">Syntax error in client request</td>
</tr>
<tr>
<td style="text-align:left">403</td>
<td style="text-align:left">Forbidden</td>
<td style="text-align:left">No permission</td>
</tr>
<tr>
<td style="text-align:left">404</td>
<td style="text-align:left">Not Found</td>
<td style="text-align:left">Not found resource</td>
</tr>
<tr>
<td style="text-align:left">500</td>
<td style="text-align:left">Internal Server Error</td>
<td style="text-align:left">Internal server error</td>
</tr>
<tr>
<td style="text-align:left">200</td>
<td style="text-align:left">OK</td>
<td style="text-align:left">Normal</td>
</tr>
</tbody>
</table>
<h3>Example</h3>
<h3>Request example</h3>
<pre><code>http:serverIp:8848/nacos/v1/cs/configs

http body：
dataId=dataIdparam&amp;group=groupParam&amp;tenant=tenantParam&amp;content=contentParam

</code></pre>
<h4>Response example</h4>
<pre><code>true
</code></pre>
<h2>Delete configuration</h2>
<h3>Description</h3>
<p>It deletes configurations in Nacos.</p>
<h3>Request Type</h3>
<p>DELETE</p>
<h3>Request URL</h3>
<p>/nacos/v1/cs/configs</p>
<h3>Request parameters</h3>
<table>
<thead>
<tr>
<th style="text-align:left">Name</th>
<th style="text-align:left">Type</th>
<th style="text-align:left">Required</th>
<th style="text-align:left">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">tenant</td>
<td style="text-align:left">String</td>
<td style="text-align:left">No</td>
<td style="text-align:left">The tenant, corresponding to the namespace field of Nacos</td>
</tr>
<tr>
<td style="text-align:left">dataId</td>
<td style="text-align:left">String</td>
<td style="text-align:left">Yes</td>
<td style="text-align:left">Configuration ID</td>
</tr>
<tr>
<td style="text-align:left">group</td>
<td style="text-align:left">String</td>
<td style="text-align:left">Yes</td>
<td style="text-align:left">Configuration group</td>
</tr>
</tbody>
</table>
<h3>Response parameters</h3>
<table>
<thead>
<tr>
<th style="text-align:left">Parameter type</th>
<th style="text-align:left">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">boolean</td>
<td style="text-align:left">If the deletion is successful</td>
</tr>
</tbody>
</table>
<h3>Error code</h3>
<table>
<thead>
<tr>
<th style="text-align:left">Error code</th>
<th style="text-align:left">Description</th>
<th style="text-align:left">Meaning</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">400</td>
<td style="text-align:left">Bad Request</td>
<td style="text-align:left">Syntax error in client request</td>
</tr>
<tr>
<td style="text-align:left">403</td>
<td style="text-align:left">Forbidden</td>
<td style="text-align:left">No permission</td>
</tr>
<tr>
<td style="text-align:left">404</td>
<td style="text-align:left">Not Found</td>
<td style="text-align:left">Not found resource</td>
</tr>
<tr>
<td style="text-align:left">500</td>
<td style="text-align:left">Internal Server Error</td>
<td style="text-align:left">Internal server error</td>
</tr>
<tr>
<td style="text-align:left">200</td>
<td style="text-align:left">OK</td>
<td style="text-align:left">Normal</td>
</tr>
</tbody>
</table>
<h3>Example</h3>
<h4>Request example</h4>
<pre><code>http:serverIp:8848/nacos/cs/configs?dataId=dataIdparam&amp;group=groupParam

</code></pre>
<h4>Response example</h4>
<pre><code>true
</code></pre>
<h1>Service Discovery API</h1>
<h2>Register Instance</h2>
<h3>Description</h3>
<p>Register an instance to service.</p>
<h3>Request Type</h3>
<p>PUT</p>
<h3>Request Path</h3>
<pre><code class="language-plain">/nacos/v1/ns/instance
</code></pre>
<h3>Request Parameters</h3>
<table>
<thead>
<tr>
<th style="text-align:left">Name</th>
<th style="text-align:left">Type</th>
<th style="text-align:left">Required</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">ip</td>
<td style="text-align:left">String</td>
<td style="text-align:left">yes</td>
<td>IP of instance</td>
</tr>
<tr>
<td style="text-align:left">port</td>
<td style="text-align:left">int</td>
<td style="text-align:left">yes</td>
<td>Port of instance</td>
</tr>
<tr>
<td style="text-align:left">tenant</td>
<td style="text-align:left">String</td>
<td style="text-align:left">no</td>
<td>ID of tenant</td>
</tr>
<tr>
<td style="text-align:left">weight</td>
<td style="text-align:left">double</td>
<td style="text-align:left">no</td>
<td>Weight</td>
</tr>
<tr>
<td style="text-align:left">enable</td>
<td style="text-align:left">boolean</td>
<td style="text-align:left">no</td>
<td>enabled or not</td>
</tr>
<tr>
<td style="text-align:left">healthy</td>
<td style="text-align:left">boolean</td>
<td style="text-align:left">no</td>
<td>healthy or not</td>
</tr>
<tr>
<td style="text-align:left">metadata</td>
<td style="text-align:left">String</td>
<td style="text-align:left">no</td>
<td>extended information</td>
</tr>
<tr>
<td style="text-align:left">clusterName</td>
<td style="text-align:left">String</td>
<td style="text-align:left">no</td>
<td>cluster name</td>
</tr>
<tr>
<td style="text-align:left">serviceName</td>
<td style="text-align:left">String</td>
<td style="text-align:left">yes</td>
<td>service name</td>
</tr>
</tbody>
</table>
<h3>Request Example</h3>
<pre><code class="language-plain">curl -X PUT 'http://127.0.0.1:8848/nacos/v1/ns/instance?port=8848&amp;healthy=true&amp;ip=11.11.11.11&amp;weight=1.0&amp;serviceName=nacos.test.3&amp;encoding=GBK&amp;tenant=n1''
</code></pre>
<h3>Response Example</h3>
<p>ok</p>
<h2>Deregister Instance</h2>
<h3>Description</h3>
<p>Delete instance from service.</p>
<h3>Request Type</h3>
<p>DELETE</p>
<h3>Request Path</h3>
<pre><code class="language-plain">/nacos/v1/ns/instance
</code></pre>
<h3>Request Parameters</h3>
<table>
<thead>
<tr>
<th style="text-align:left">Name</th>
<th style="text-align:left">Type</th>
<th style="text-align:left">Required</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">serviceName</td>
<td style="text-align:left">String</td>
<td style="text-align:left">yes</td>
<td>Service name</td>
</tr>
<tr>
<td style="text-align:left">ip</td>
<td style="text-align:left">String</td>
<td style="text-align:left">yes</td>
<td>IP of instance</td>
</tr>
<tr>
<td style="text-align:left">port</td>
<td style="text-align:left">int</td>
<td style="text-align:left">yes</td>
<td>Port of instance</td>
</tr>
<tr>
<td style="text-align:left">cluster</td>
<td style="text-align:left">String</td>
<td style="text-align:left">yes</td>
<td>Cluster name</td>
</tr>
<tr>
<td style="text-align:left">tenant</td>
<td style="text-align:left">String</td>
<td style="text-align:left">no</td>
<td>ID of tenant</td>
</tr>
</tbody>
</table>
<h3>Request Example</h3>
<pre><code class="language-plain">curl -X DELETE 127.0.0.1:8848/nacos/v1/ns/instance?serviceName=nacos.test.1&amp;ip=1.1.1.1&amp;port=8888&amp;cluster=TEST1
</code></pre>
<h3>Response Example</h3>
<p>ok</p>
<h2>Modify Instance</h2>
<h3>Description</h3>
<p>Modify an instance of service.</p>
<h3>Request Type</h3>
<p>POST</p>
<h3>Request Path</h3>
<pre><code class="language-plain">/nacos/v1/ns/instance/update
</code></pre>
<h3>Request Parameters</h3>
<table>
<thead>
<tr>
<th style="text-align:left">Name</th>
<th style="text-align:left">Type</th>
<th style="text-align:left">Required</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">serviceName</td>
<td style="text-align:left">String</td>
<td style="text-align:left">yes</td>
<td>Service name</td>
</tr>
<tr>
<td style="text-align:left">ip</td>
<td style="text-align:left">String</td>
<td style="text-align:left">yes</td>
<td>IP of instance</td>
</tr>
<tr>
<td style="text-align:left">port</td>
<td style="text-align:left">int</td>
<td style="text-align:left">yes</td>
<td>Port of instance</td>
</tr>
<tr>
<td style="text-align:left">cluster</td>
<td style="text-align:left">String</td>
<td style="text-align:left">yes</td>
<td>Cluster name</td>
</tr>
<tr>
<td style="text-align:left">tenant</td>
<td style="text-align:left">String</td>
<td style="text-align:left">no</td>
<td>ID of tenant</td>
</tr>
<tr>
<td style="text-align:left">weight</td>
<td style="text-align:left">double</td>
<td style="text-align:left">no</td>
<td>Weight</td>
</tr>
<tr>
<td style="text-align:left">metadata</td>
<td style="text-align:left">JSON</td>
<td style="text-align:left">no</td>
<td>Extended information</td>
</tr>
</tbody>
</table>
<h3>Request Example</h3>
<pre><code class="language-plain">curl -X POST 127.0.0.1:8848/nacos/v1/ns/instance/update?serviceName=nacos.test.1&amp;ip=1.1.1.1&amp;port=8888&amp;cluster=TEST1&amp;weight=8&amp;metadata={}
</code></pre>
<h3>Response Example</h3>
<p>ok</p>
<h2>Query Instances</h2>
<h3>Description</h3>
<p>Query instance list of service.</p>
<h3>Request Type</h3>
<p>GET</p>
<h3>Request Path</h3>
<pre><code class="language-plain">/nacos/v1/ns/instance/list
</code></pre>
<h3>Request Parameters</h3>
<table>
<thead>
<tr>
<th style="text-align:left">Name</th>
<th style="text-align:left">Type</th>
<th style="text-align:left">Required</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">serviceName</td>
<td style="text-align:left">String</td>
<td style="text-align:left">yes</td>
<td>Service name</td>
</tr>
<tr>
<td style="text-align:left">tenant</td>
<td style="text-align:left">String</td>
<td style="text-align:left">no</td>
<td>ID of tenant</td>
</tr>
<tr>
<td style="text-align:left">clusters</td>
<td style="text-align:left">String, splited by comma</td>
<td style="text-align:left">no</td>
<td>Cluster name</td>
</tr>
<tr>
<td style="text-align:left">healthyOnly</td>
<td style="text-align:left">boolean</td>
<td style="text-align:left">no, default value is false</td>
<td>Return healthy instance or not</td>
</tr>
</tbody>
</table>
<h3>Request Example</h3>
<pre><code class="language-plain">curl -X GET 127.0.0.1:8848/nacos/v1/ns/instance/list?serviceName=nacos.test.1
</code></pre>
<h3>Response Example</h3>
<pre><code class="language-json">{
	<span class="hljs-attr">"dom"</span>: <span class="hljs-string">"nacos.test.1"</span>,
	<span class="hljs-attr">"cacheMillis"</span>: <span class="hljs-number">1000</span>,
	<span class="hljs-attr">"useSpecifiedURL"</span>: <span class="hljs-literal">false</span>,
	<span class="hljs-attr">"hosts"</span>: [{
		<span class="hljs-attr">"valid"</span>: <span class="hljs-literal">true</span>,
		<span class="hljs-attr">"marked"</span>: <span class="hljs-literal">false</span>,
		<span class="hljs-attr">"instanceId"</span>: <span class="hljs-string">"10.10.10.10-8888-DEFAULT-nacos.test.1"</span>,
		<span class="hljs-attr">"port"</span>: <span class="hljs-number">8888</span>,
		<span class="hljs-attr">"ip"</span>: <span class="hljs-string">"10.10.10.10"</span>,
		<span class="hljs-attr">"weight"</span>: <span class="hljs-number">1.0</span>,
		<span class="hljs-attr">"metadata"</span>: {}
	}],
	<span class="hljs-attr">"checksum"</span>: <span class="hljs-string">"3bbcf6dd1175203a8afdade0e77a27cd1528787794594"</span>,
	<span class="hljs-attr">"lastRefTime"</span>: <span class="hljs-number">1528787794594</span>,
	<span class="hljs-attr">"env"</span>: <span class="hljs-string">""</span>,
	<span class="hljs-attr">"clusters"</span>: <span class="hljs-string">""</span>
}
</code></pre>
<h2>Query Instance Detail</h2>
<h3>Description</h3>
<p>Query instance details of service.</p>
<h3>Request Type</h3>
<p>GET</p>
<h3>Request Path</h3>
<pre><code class="language-plain">/nacos/v1/ns/instance
</code></pre>
<h3>Request Parameters</h3>
<table>
<thead>
<tr>
<th style="text-align:left">Name</th>
<th style="text-align:left">Type</th>
<th style="text-align:left">Required</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">serviceName</td>
<td style="text-align:left">String</td>
<td style="text-align:left">yes</td>
<td>Service name</td>
</tr>
<tr>
<td style="text-align:left">ip</td>
<td style="text-align:left">String</td>
<td style="text-align:left">yes</td>
<td>IP of instance</td>
</tr>
<tr>
<td style="text-align:left">port</td>
<td style="text-align:left">String</td>
<td style="text-align:left">yes</td>
<td>Port of instance</td>
</tr>
<tr>
<td style="text-align:left">tenant</td>
<td style="text-align:left">String</td>
<td style="text-align:left">no</td>
<td>ID of tenant</td>
</tr>
<tr>
<td style="text-align:left">clusters</td>
<td style="text-align:left">String, splited by comma</td>
<td style="text-align:left">no</td>
<td>Cluster name</td>
</tr>
</tbody>
</table>
<h3>Request Example</h3>
<pre><code class="language-plain">curl -X GET '127.0.0.1:8848/nacos/v1/ns/instance?serviceName=nacos.test.2&amp;ip=10.10.10.10&amp;port=8888&amp;cluster=DEFAULT'
</code></pre>
<h3>Response Example</h3>
<pre><code class="language-json">{
	<span class="hljs-attr">"metadata"</span>: {},
	<span class="hljs-attr">"instanceId"</span>: <span class="hljs-string">"10.10.10.10-8888-DEFAULT-nacos.test.2"</span>,
	<span class="hljs-attr">"port"</span>: <span class="hljs-number">8888</span>,
	<span class="hljs-attr">"service"</span>: <span class="hljs-string">"nacos.test.2"</span>,
	<span class="hljs-attr">"healthy"</span>: <span class="hljs-literal">false</span>,
	<span class="hljs-attr">"ip"</span>: <span class="hljs-string">"10.10.10.10"</span>,
	<span class="hljs-attr">"clusterName"</span>: <span class="hljs-string">"DEFAULT"</span>,
	<span class="hljs-attr">"weight"</span>: <span class="hljs-number">1.0</span>
}
</code></pre>
</div></div></section><footer class="footer-container" data-reactid="121"><div class="footer-body" data-reactid="122"><img src="/img/nacos_gray.png" data-reactid="123"/><div class="cols-container" data-reactid="124"><div class="col col-12" data-reactid="125"><h3 data-reactid="126">Vision</h3><p data-reactid="127">By providing an easy-to-use service infrastructure such as dynamic service discovery, service configuration, service sharing and management and etc., Nacos help users better construct, deliver and manage their own service platform, reuse and composite business service faster and deliver value of business innovation more quickly so as to win market for users in the era of cloud native and in all cloud environments, such as private, mixed, or public clouds.</p></div><div class="col col-6" data-reactid="128"><dl data-reactid="129"><dt data-reactid="130">Documentation</dt><dd data-reactid="131"><a href="/en-us/docs/what-is-nacos.html" target="_self" data-reactid="132">Overview</a></dd><dd data-reactid="133"><a href="/en-us/docs/quick-start.html" target="_self" data-reactid="134">Quick start</a></dd><dd data-reactid="135"><a href="/en-us/docs/contributing.html" target="_self" data-reactid="136">Developer guide</a></dd></dl></div><div class="col col-6" data-reactid="137"><dl data-reactid="138"><dt data-reactid="139">Resources</dt><dd data-reactid="140"><a href="/en-us/community/index.html" target="_self" data-reactid="141">Community</a></dd></dl></div></div><div class="copyright" data-reactid="142"><span data-reactid="143">@ 2018 The Nacos Authors | An Alibaba Middleware (Aliware) Project</span></div></div></footer></div></div>
	<script src="https://f.alicdn.com/react/15.4.1/react-with-addons.min.js"></script>
	<script src="https://f.alicdn.com/react/15.4.1/react-dom.min.js"></script>
	<script>
		window.rootPath = '';
  </script>
	<script src="/build/documentation.js"></script>
</body>
</html>